1. Field of the Invention
The present invention relates to an architecture, system and method for in-circuit emulation. More particularly, the present invention relates to an architecture and system for performing in-circuit emulation of microcontrollers and microprocessors having a bus shared by at least two data processing elements and a method of performing in-circuit emulation using a bus shared by at least two data processing elements.
2. Related Art
Soon after the development of the microprocessor, semiconductor process technology advanced to the point where it became possible to integrate enough Read Only Memory (ROM) and Random Access Memory (RAM) on a single chip along with a Central Processing Unit (CPU) to make a useful single-chip microcomputer. These single-chip microcomputers are often referred to as microcontrollers. Typically, a microcontroller includes a ROM for storing one or more software programs, RAM for storage of variables used by the program(s) during operation, a CPU for performing various arithmetic and logical functions and a plurality of Input/Output (I/O) lines. These I/O lines are often viewed in groups of eight and the groups are referred to collectively as I/O ports, or simply ports. Sometimes individual I/O lines are referred to as port pins. Microcontrollers also often include peripheral functions such as timers, counters, serial or parallel communication channels, A/D converters, and D/A converters. Representative examples of microcontrollers described above are the well-known 68HC11 (manufactured by Motorola Corp.) and the 8051 family of microcontrollers (manufactured by Intel Corporation of Santa Clara, Calif., Signetics Corporation of Sunnyvale, Calif., and others). As a particular example, the 8052 microcontroller, a member of the 8051 microcontroller family, includes in addition to a CPU, a 256 byte RAM, an 8192 byte ROM, an interrupt controller, a full duplex Universal Asynchronous Receiver/Transmitter (UART), three 16 bit timer/counters, and four 8 bit general purpose I/O ports. FIG. 3 is a block diagram showing the architecture of the 8051.
The unit volume of microcontrollers used each year has generally been increasing over the years since these devices were first introduced. Not only has the unit volume been increasing, but the number of systems, i.e., applications, into which these devices have been designed has also been increasing.
One problem that arises in using these single-chip microcontrollers has to do with debugging systems incorporating these devices. Remembering that the program memory and variable memory are integrated onto the single-chip microcontroller, people skilled in the art will appreciate that access to the internal address and data buses of the microcontroller, which is useful in debugging a new design, is limited by the fact that these signals are not generally accessible outside the chip.
In-circuit emulators (hereafter "emulators") are tools for use in designing systems incorporating microcontrollers. These emulators enable system designers and programmers to determine whether their software is operating as intended. Further, these emulators make it relatively easy to debug software programs. Using these tools, system designers, engineers, programmers and technicians can interactively control and examine the state of the system at any chosen time, as well as control the execution of programs under development. This is essential for reducing the time required for debugging a system design which includes a microcontroller.
Typically, an emulator is a separate hardware/software product that emulates the microcontroller in a target system. The emulator is electrically coupled to a target system by means of a cable and connector that connects to the target system in the same manner that the microcontroller would connect to the target system. The emulator can execute program code stored in the memory of the target system, as well as code which has been stored in its own memory areas. An emulator provides not only the capabilities of the target processor, but a set of debugging capabilities to facilitate and shorten the debugging process. Emulators provide read/write access to all signals and all data to which the microcontroller has access, including information which resides inside the microcontroller. Access to this information enables engineers to effectively control and debug a microcontroller application. Design aspects of an in-circuit emulator for an 8051 type microcontroller manufactured by Metalink Corp. of Chandler, Ariz., are discussed in U.S. Pat. No. 4,939,637 and that patent is hereby incorporated herein, in its entirety, by reference.
One use of an emulator is in software development. The emulator executes the program exactly as the target system would, in real time, and it provides a wide variety of interactive debugging capabilities and facilities. Therefore, software developed using the emulator can be completely debugged, except for the hardware interface, before it is integrated with the system hardware.
A second use of an emulator is in the integration of the target system software and hardware. Even when the target system hardware and software have been individually (i.e., separately) debugged, new problems can, and often do, surface when the target system software and hardware are joined together. In this case the emulator serves to facilitate debugging of the hardware-software combination. Furthermore, after a prototype has been debugged, the emulator can be used to test the compliance of the new hardware-software combination with the design specification. Worst case parametric tests can be developed and tested on the prototype. This provides the designer with valuable information about the limitations of the system. It also provides the capability for test programs which can be used in the manufacturing process.
A third use of an emulator is in product-manufacturing. The same test routines used to develop and debug the prototype, or even more comprehensive test routines, can be used to test the finished products. Non-functioning units can be easily debugged using the debugging capability of the emulator.
A fourth use of an emulator is in field service. Rapid debugging of a product that has failed in the field is a valuable service that can be provided to customers.
Additionally, the growing trend of concurrent engineering, wherein all phases of product development, e.g., electrical design, mechanical design, test, and manufacturing are carried out simultaneously, requires substantially all members of a product development team to have access to development tools.
FIG. 1 shows the internal datapath of a conventional 8051 family in-circuit emulator, designated by general reference numeral 100, designed with two microcontrollers, a control processor 102 for control and interface purposes and an emulation processor 104 for actually executing the target program. Control processor 102, and emulation processor 104 have multiplexed address/data buses and each needs to access an emulation memory 106. (Members of the 8051 family of microcontrollers, PORT0 and PORT2 are active in fetching external instructions and data.) Emulation memory 106 is coupled to an address bus 108 and a data bus 110. In order to achieve a complete 16-bit address for read/write access to emulation memory 106, control processor 102 stores the low-order byte of an address into address latch 112. PORT0 of control processor 102 is coupled onto the inputs of address latch 112 via a tri-state buffer 116. The output of address latch 112 is coupled onto a first portion of address bus 108. PORT0 of control processor 102 is connected to the inputs of tri-state buffer 116 the outputs of which are in turn connected to data bus 110. A tri-state buffer 118 selectively couples the output of PORT2 of control processor 102 onto a second portion of address bus 108. Data read from emulation memory 106 is returned to PORT0 of control processor 102 via tri-state buffer 120 which has its inputs connected to data bus 110 and its outputs connected to PORT0 of control processor 102. Similarly, in order to achieve a complete 16-bit address for read/write access to emulation memory 106 emulation processor 104 stores the low-order byte of an address into address latch 112. PORT0 of emulation processor 104 is connected to the inputs of a tri-state buffer 126, the outputs of which are in turn connected to data bus 110. A tri-state buffer 130 selectively couples the output of PORT2 of emulation processor 104 onto a second portion of address bus 108. Data read from emulation memory 106 is returned to PORT0 of emulation processor 104 via tri-state buffer 128 which has its inputs connected to data bus 110 and its outputs connected to PORT0 of emulation processor 104.
FIG. 1 also shows a wait memory 140 having an output coupled to PORT0 of emulation processor 104 via a tri-state buffer 142. Monitor RAM 150 and monitor ROM 152 are both coupled onto emulation data bus 110 via tri-state buffer 154 and then coupled onto PORT0 of emulation processor 104 via tri-state buffer 128. Address bus 108 is coupled directly to Monitor RAM 150 and Monitor ROM 152.
FIG. 1 also shows an address latch 160 having inputs coupled PORT0 of control processor 102, and having outputs coupled to a first portion of the address inputs of a control processor firmware memory 162. Control processor firmware memory 162 has a second portion of address inputs coupled to PORT2 of control processor 102, and a data bus port coupled to PORT0 of control processor 102.
As shown in FIG. 1, use of the dual processor architecture with the multiplexed address/data buses forces the use of a number of tri-state buffers with their associated control, and corresponding interconnect, as well as separate memories to achieve functions such as waiting.
So, microcontroller use has been increasing not just in volume but in the number applications being designed. In-circuit emulators are a necessary tool for achieving both a high level of confidence in a design and a short time-to-market.
In view of the many uses of an emulator, the growing popularity of concurrent engineering, and the large number of embedded microcontroller applications existing and being developed, it can be seen that there is a need for a large number of emulator systems in this field. Therefore there is a corresponding need to reduce the cost, size, and power consumption of emulators, while simultaneously increasing their reliability. Such goals are desirable to achieve commercial success in this market.